home *** CD-ROM | disk | FTP | other *** search
- /* Copyright, 1990, Regents of the University of Colorado */
- /* main routine for all non host environments*/
-
- #include "D_lib.h"
- #include "internal.h"
- #include <stdio.h>
-
- extern int D_ci;
-
- /********************************************************************
- *
- * NAME: D_comp_driver --- Main driver on the nodes that looks
- * for and calls composite procedures.
- *
- * INPUTS:
- *
- * OUTPUTS:
- *
- * NOTES: See the formal interface description for more
- * information.
- *
- ********************************************************************/
-
- void D_comp_driver()
- {
- int cnt;
- int node;
- int pid;
-
- for (;;)
- {
- #if (D_MACH==D_CUBE)
- while (probe(D_ci, D_CPC_MTYPE) < 0)
- flick();
- #elif (D_MACH==D_SIM)
- #else
- while (iprobe(D_CPC_MTYPE) == 0)
- flick();
- #endif
-
-
- #if (D_MACH==D_SIM || D_MACH==D_CUBE)
- recvw(D_ci, D_CPC_MTYPE, &(D_mess_buf[0]), D_MAX_MESS,
- &cnt, &node, &pid);
- #else
- crecv((long)D_CPC_MTYPE, &(D_mess_buf[0]), (long)D_MAX_MESS);
- #endif
- (*D_comps[D_mess_lint[3]])();
- }
- }
-
- #if (D_MACH==D_GRAIL)
- nd_main() {
- #else
- main(){
- #endif
- D_env_init(((int) D_last_env) + 1);
-
- /*initialize distributed data constants*/
- D_init_global_const();
- D_init_global_map();
- D_init_local_const();
- D_init_local_map();
-
- /*handle composite procedures forever*/
- D_comp_driver();
- };
-
-